<template>
	<view class="Card">
		<view class="membershipCard" :style="{backgroundImage: userQuery.is_bright?member1:member2}">
			<view class="header">
				<image :src="userQuery.is_bright?$IMG_URL('/static/newVersion/vip1.png'):$IMG_URL('/static/user/logo2.png')" mode="aspectFill" class="logo"></image>
				<view class="center">
					<image :src="$IMG_URL('/static/user/memberSize.png')" mode="" class="memberSize"></image>
				</view>
				<view :class="userQuery.is_bright?'btn1':'btn2'" @click="routeMember">
					{{userQuery.button_str}}
				</view>
			</view>
			<view class="bottom">
				<view class="size1">
					{{userQuery.title}}
				</view>
				<view class="size2">
					{{userQuery.describe}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props: {
			userQuery:{
				type: Object,
				default: {
					is_bright:0
				},
				required: true
			}
		},
		data(){
			return{
				member1:'url(https://ugeego.youjixiaoyang.com/static/member/qbj.png)',
				member2:'url(https://ugeego.youjixiaoyang.com/static/member/bj.png)'
			}
		},
		methods:{
			routeMember(){
				if(!this.userQuery.is_bright){
					uni.navigateTo({
						url:'/pageA/member/purchase'
					})
				}else if(this.userQuery.is_bright == 1){
					uni.navigateTo({
						url:'/pageB/user/cardBag'
					})
				}else if(this.userQuery.is_bright == 2){
					uni.navigateTo({
						url:'/pageA/member/purchase'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.Card{
		width: 100%;
		padding: 0 32rpx;
	}
	.membershipCard{
		width: 686rpx;
		height: 234rpx;
		background-repeat: no-repeat no-repeat;
		background-size: cover;
		display: flex;
		flex-direction: column;
		.header{
			width: 100%;
			height: 90rpx;
			padding: 0 18rpx 0 36rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			
			.logo{
				width: 48rpx;
				height: 48rpx;
				margin-right: 12rpx;
			}
			.center{
				display: flex;
				flex-direction: row;
				align-items: center;
				flex: 1;
				.memberSize{
					width: 302rpx;
					height: 46rpx;
				}
			}
			.btn1{
				width: 80px;
				height: 30px;
				background: linear-gradient(90deg,#ffffff, #ccfffb);
				border: 1px solid #ffffff;
				border-radius: 8px;
				font-size: 14px;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #375957;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			.btn2{
				width: 80px;
				height: 30px;
				background: #ffffff;
				border: 1px solid #ffffff;
				border-radius: 8px;
				font-size: 14px;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #333333;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
		.bottom{
			width: 100%;
			height: 117rpx;
			display: flex;
			flex-direction: column;
			padding: 34rpx 0 0 34rpx;
			.size1{
				opacity: 0.6;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: left;
				color: #000000;
			}
			.size2{
				opacity: 0.4;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC-Medium;
				font-weight: 500;
				text-align: left;
				color: #000000;
			}
		}
	}
</style>